/*
 * Copyright (c) 2023, 2023,yzc.cn All rights reserved.
 *
 */
package cn.yzc.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import java.util.HashMap;
import java.util.Map;

/**
 * <p>Project: SpringColud - OrderController</p>
 * <p>Powered by yzc On 2023-12-26 20:14:46</p>
 * <p>描述：<p>
 *
 * @author yzc [yzc0415@126.com]
 * @version 1.0
 * @since 17
 */
@RestController
public class OrderController {
    @Autowired
    RestTemplate restTemplate;


    @GetMapping("/order")
    public Map orderGet(){
        System.out.println("生成订单");
        Map rs = restTemplate.getForObject("http://sc-good/good?id=10", Map.class);
        Map map = new HashMap<>();
        map.put("code","200");
        map.put("message","生成订单成功");
        map.put("data",rs);
        return map;
    }
}
